home *** CD-ROM | disk | FTP | other *** search
/ Clipper Collection / Clipper Collection.iso / clipper7 / clipwind.arc / WDEMO87.PRG < prev    next >
Text File  |  1988-03-23  |  22KB  |  646 lines

  1. SET SCOREBOARD OFF
  2. CLEAR
  3. * initialize border characters
  4. double = 201
  5. sgldbl = 213
  6. dblsgl = 214
  7. single = 218
  8.  
  9. * see if this is a color system
  10. IF ISCOLOR()
  11.    ltr1clr = "B/H/"
  12.    ltr2clr = "G/H/"
  13.    ltr3clr = "C/H/"
  14.    ltr4clr = "R/H/"
  15.    ltr5clr = "M/H/"
  16.    ltr6clr = "O/H/"
  17.    ltr7clr = "W/H/"
  18.    fastclr = "R/H/"
  19.    wnc1clr = "A/O/H/"
  20.    wnc2clr = "W/M/H/"
  21.    wnc3clr = "R/C/H/"
  22.    wnc4clr = "O/G/H/"
  23.    wnc5clr = "B/W/H/"
  24.    wnc6clr = "A/R/H/"
  25.    wnc7clr = "B/W/H"
  26.    wnb1clr = "B/W/H/"
  27.    wnb2clr = "A/R/H/"
  28.    wnp1clr = "C/O/H/"
  29.    wnp2clr = "W/A/"
  30.    wnp3clr = "W/R/H/"
  31. ELSE
  32.    ltr1clr = "W/H/"
  33.    ltr2clr = "W/H/"
  34.    ltr3clr = "W/H/"
  35.    ltr4clr = "W/H/"
  36.    ltr5clr = "W/H/"
  37.    ltr6clr = "W/H/"
  38.    ltr7clr = "W/H/"
  39.    fastclr = "W/H/"
  40.    wnc1clr = "W/A//"
  41.    wnc2clr = "W/A//"
  42.    wnc3clr = "W/A//"
  43.    wnc4clr = "W/A//"
  44.    wnc5clr = "W/A//"
  45.    wnc6clr = "A/W//"
  46.    wnc7clr = "A/W/H/"
  47.    wnb1clr = "A/W//"
  48.    wnb2clr = "A/W//"
  49.    wnp1clr = "W/A/"
  50.    wnp2clr = "W/A/"
  51.    wnp3clr = "W/A/"
  52. ENDIF
  53. SET CURSOR OFF
  54. STORE 0 to wn1, wn2, wn3, wn4, wn5, wn6, wn7
  55. @ 24,0 SAY ' '
  56. TEXT
  57.  
  58.                   Windows For Clipper / Summer '87 Version
  59.  
  60.        Welcome, this is a demo of the Windows For  Clipper Library for the 
  61.     Summer '87  version of the Clipper compiler. This demo will give you a
  62.     breif introduction to the power of  the library and what it can do for
  63.     you. The source code for this demo is included so you can see how easy
  64.     it  is to use the window  functions.  The library contains  all of the 
  65.     basic functions needed to create and manipulate windows in the Clipper
  66.     programming language. There  are other video functions  included also.
  67.     The  NEWCOLOR()  and  BIGSTR() functions. The NEWCOLOR() function will
  68.     change  the the color  of any  target  area of the current screen. You
  69.     can change a single character, a segment of any line, or a whole block 
  70.     area of the screen. The BIGSTR() function will write large characters.
  71.     Each character is 8 columns wide  and 8 rows high. This function  is a
  72.     good  way to  create impressionable,  high visibility  opening screens. 
  73.     You will see examples of this in a  moment. 
  74.  
  75.  
  76.        For professional  looking applications  order your  copy today. For 
  77.     ordering information,  please see the  REGISTER.DOC file included with
  78.     this demo.
  79.                          Press A key when you're ready 
  80.  
  81. ENDTEXT
  82. INKEY(0)
  83. CLEAR
  84. STORE 0 to wn1, wn2, wn3, wn4, wn5, wn6, wn7
  85.  
  86. * init first window and use defaults
  87. wn1 = _SINIT_WN(1,16,8,8)
  88.  
  89. * draw the window on screen
  90. _SDRW_WN(wn1)
  91.  
  92. * put a big letter in it
  93. _BIGSTR("W",1,16,CHR(219), ltr1clr, 1)
  94.  
  95. * move the window into postion
  96. MV_WN(wn1,0,0)
  97.  
  98. * init the second window
  99. wn2 = _SINIT_WN(1,16,8,8)
  100.  
  101. * draw the window on screen
  102. _SDRW_WN(wn2)
  103.  
  104. * put a big letter on the screen
  105. _BIGSTR("e",1,16,CHR(219), ltr2clr, 1)
  106.  
  107. * move the window into postion
  108. MV_WN(wn2,8,0)
  109.  
  110. * init the third window
  111. wn3 = _SINIT_WN(1,16,8,8)
  112.  
  113. * draw the window on screen
  114. _SDRW_WN(wn3)
  115.  
  116. * put a big letter on the screen
  117. _BIGSTR("l",1,16,CHR(219), ltr3clr, 1)
  118.  
  119. * move the window into postion
  120. MV_WN(wn3,16,0)
  121.  
  122. * init the fourth window
  123. wn4 = _SINIT_WN(1,16,8,8)
  124.  
  125. * draw the window on screen
  126. _SDRW_WN(wn4)
  127.  
  128. * put a big letter on the screen
  129. _BIGSTR("c",1,16,CHR(219), ltr4clr, 1)
  130.  
  131. * move the window into postion
  132. MV_WN(wn4,24,0)
  133.  
  134. * init the fifth window
  135. wn5 = _SINIT_WN(1,16,8,8)
  136.  
  137. * draw the window on screen
  138. _SDRW_WN(wn5)
  139.  
  140. * put a big letter on the screen
  141. _BIGSTR("o",1,16,CHR(219), ltr5clr, 1)
  142.  
  143. * move the window into postion
  144. MV_WN(wn5,32,0)
  145.  
  146. * init the sixth window
  147. wn6 = _SINIT_WN(1,16,8,8)
  148.  
  149. * draw the window on screen
  150. _SDRW_WN(wn6)
  151.  
  152. * put a big letter on the screen
  153. _BIGSTR("m",1,16,CHR(219), ltr6clr, 1)
  154.  
  155. * move the window into postion
  156. MV_WN(wn6,40,0)
  157.  
  158. * init the seventh window
  159. wn7 = _SINIT_WN(1,16,8,8)
  160.  
  161. * draw the window on screen
  162. _SDRW_WN(wn7)
  163.  
  164. * put a big letter on the screen
  165. _BIGSTR("e",1,16,CHR(219), ltr7clr, 1)
  166.  
  167. * move the window into postion
  168. MV_WN(wn7,48,0)
  169.  
  170. @ 19,06 SAY "Impressive ? Well, if you think so that's great! If you're not convinced"
  171. @ 20,04 SAY "yet, just stick around. Maybe what you will see in the rest of the demo"
  172. @ 21,04 SAY "will impress you. I hope so!"
  173. @ 23,26 SAY "Press Any Key To Continue"
  174. * delay half second.
  175. INKEY(.5)
  176. * write a big string!
  177. _BIGSTR("FAST!",20,10,CHR(177), fastclr, 1)
  178.  
  179. key = 0
  180. * make the last lines color fluctuate
  181. DO WHILE key = 0
  182.    IIF(ISCOLOR(), _NEWCOLOR(26,23,51,23, "A/R/"), _NEWCOLOR(26,23,51,23, "W/A/"))
  183.    FOR n = 1 TO 150
  184.    NEXT
  185.    IIF(ISCOLOR(), _NEWCOLOR(26,23,51,23, "A/B/"), _NEWCOLOR(26,23,51,23, "A/W/"))
  186.    key = INKEY(.1)
  187. ENDDO
  188. * remove the windows from memory
  189. _SREM_WN(wn1)
  190. _SREM_WN(wn2)
  191. _SREM_WN(wn3)
  192. _SREM_WN(wn4)
  193. _SREM_WN(wn5)
  194. _SREM_WN(wn6)
  195. _SREM_WN(wn7)
  196. * reset variable values to 0
  197. Store 0 to wn1, wn2, wn3, wn4, wn5
  198. * initialize needed windows
  199. wn1 = _SINIT_WN(0,0,28,9)
  200. wn2 = _SINIT_WN(50,0,28,9)
  201. wn3 = _SINIT_WN(50,14,28,9)
  202. wn4 = _SINIT_WN(0,14,28,9)
  203. wn5 = _SINIT_WN(25,7,28,9)
  204. * set borders, colors etc.
  205. _SST_WNBC(wn1, double)
  206. _SST_WNBC(wn2, double)
  207. _SST_WNBC(wn3, double)
  208. _SST_WNBC(wn4, double)
  209. _SST_WNBC(wn5, double)
  210. _SST_WNCL(wn1, wnc1clr, "C")
  211. _SST_WNCL(wn2, wnc2clr, "C")
  212. _SST_WNCL(wn3, wnc3clr, "C")
  213. _SST_WNCL(wn4, wnc4clr, "C")
  214. _SST_WNCL(wn5, wnc5clr, "C")
  215. _SST_WNCL(wn1, wnb1clr, "B")
  216. _SST_WNCL(wn2, wnb1clr, "B")
  217. _SST_WNCL(wn3, wnb1clr, "B")
  218. _SST_WNCL(wn4, wnb1clr, "B")
  219. _SST_WNCL(wn5, wnb1clr, "B")
  220.  
  221. * make the windows do a dance
  222. FOR n = 1 TO 3
  223.    _SDRW_WN(wn1)
  224.    _SWTE_TXT(wn1, " ")
  225.    _SWTE_TXT(wn1, " ")
  226.    _SWTE_TXT(wn1, " ")
  227.    _SWTE_TXT(wn1, "   They're easy to use  ")
  228.    _SWTE_TXT(wn1, " ")
  229.    _SWTE_TXT(wn1, "     Not confusing.")
  230.    INKEY(.1)
  231.    _SDRW_WN(wn2)
  232.    _SWTE_TXT(wn2, " ")
  233.    _SWTE_TXT(wn2, " ")
  234.    _SWTE_TXT(wn2, " ")
  235.    _SWTE_TXT(wn2, "   They're Very fast    ")
  236.    _SWTE_TXT(wn2, " ")
  237.    _SWTE_TXT(wn2, "      Not Clunkers.")
  238.    INKEY(.1)
  239.    _SDRW_WN(wn3)
  240.    _SWTE_TXT(wn3, " ")
  241.    _SWTE_TXT(wn3, " ")
  242.    _SWTE_TXT(wn3, " ")
  243.    _SWTE_TXT(wn3, "   They need very little")
  244.    _SWTE_TXT(wn3, " ")
  245.    _SWTE_TXT(wn3, "   ram to operate.")
  246.    INKEY(.1)
  247.    _SDRW_WN(wn4)
  248.    _SWTE_TXT(wn4, " ")
  249.    _SWTE_TXT(wn4, " ")
  250.    _SWTE_TXT(wn4, " ")
  251.    _SWTE_TXT(wn4, "   Designed specifically")
  252.    _SWTE_TXT(wn4, "          for the" )
  253.    _SWTE_TXT(wn4, "     Clipper Compiler")
  254.    INKEY(.1)
  255.    _SDRW_WN(wn5)
  256.    _SWTE_TXT(wn5, "    WINDOWS FOR CLIPPER")
  257.    _SWTE_TXT(wn5, "        Version 2.0")
  258.    _SWTE_TXT(wn5, "       By Jim Holley")
  259.    _SWTE_TXT(wn5, "   1346 Woodington Cir.")
  260.    _SWTE_TXT(wn5, "  Lawrenceville Ga, 30244")
  261.    _SWTE_TXT(wn5, " ")
  262.    _SWTE_TXT(wn5, " Clipper is a trademark of")
  263.    _SWTE_TXT(wn5, "    Nantucket Corp.")
  264.    IF n = 3
  265.       EXIT                             && not terminating loop prematurely
  266.                                        && just bypassing the next step
  267.    ENDIF
  268.    INKEY(.1)
  269.    _SWNERASE(wn5)
  270.    INKEY(.1)
  271.    _SWNERASE(wn4)
  272.    INKEY(.1)
  273.    _SWNERASE(wn3)
  274.    INKEY(.1)
  275.    _SWNERASE(wn2)
  276.    INKEY(.1)
  277.    _SWNERASE(wn1)
  278.    INKEY(.1)
  279.  
  280. NEXT
  281. INKEY(5)
  282. * remove the windows from memory
  283. _SREM_WN(wn5)
  284. _SREM_WN(wn4)
  285. _SREM_WN(wn3)
  286. _SREM_WN(wn2)
  287. _SREM_WN(wn1)
  288. CLEAR
  289. *************************************
  290. * Write standard text on the screen *
  291. *************************************
  292. @ 02,20 SAY "Demonstration of Windowed Database" 
  293. @ 06,21 SAY "Its as easy as this" 
  294. @ 08,21 SAY "USE <database name>" 
  295. @ 09,21 SAY 'cur_record = _wn_dbf(wn,"Field" [,"Field" ,"Field"....])'
  296. @ 10,02 SAY "A place to put                                      " 
  297. @ 11,02 SAY "the record #  ─────────┘          │     │      │        │        optional, up" 
  298. @ 12,02 SAY "Returned.                         │     │      │        └─────── to 10 fields" 
  299. @ 13,36 SAY "│     │      │                 allowed." 
  300. @ 14,14 SAY "Call the              │     │      │             The field names" 
  301. @ 15,14 SAY "function.  ───────────┘     │      └─────────────To write." 
  302. @ 16,42 SAY "│     The window" 
  303. @ 17,42 SAY "└──── to write in." 
  304.  
  305. * initialize needed variables
  306. STORE 0 TO wn1, wn2, wn3
  307.  
  308. * initialize a window
  309. wn2 = _SINIT_WN(0, 18, 78, 5)
  310.  
  311. * set borders, colors etc.
  312. _SST_WNCL(wn2, wnc6clr, "C")
  313. _SST_WNCL(wn2, wnb2clr, "B")
  314. _SST_WNBC(wn2, sgldbl)
  315.  
  316. * put the window on the screen
  317. _SDRW_WN(wn2)
  318.  
  319. * writes some text in the window
  320. _SWTE_TXT(wn2, "      The Windows For Clipper library provides special functions that use")
  321. _SWTE_TXT(wn2, "   database fields as arguments. These functions allow you to present the")
  322. _SWTE_TXT(wn2, "   information contained in the database in any window regardless of size.")
  323. _SWTE_TXT(wn2, "   Watch the next window for an example.")
  324. _SWTE_TXT(wn2, "                         Press Any Key To Continue")
  325. INKEY(0)
  326.  
  327. * initialize another window
  328. wn1 = _sinit_wn(5, 3, 70, 10)       && init window to desired coordinates
  329.  
  330. * set borders, colors etc.
  331. _SST_WNCL(wn1, wnc7clr, "C")        && set contents color
  332. _SST_WNCL(wn1, wnb2clr, "B")        && set border color
  333. _SST_WNBC(wn1, dblsgl)              && set border character
  334. _SST_PTSL(wn1, 1)                   && select old stype pointer type
  335. _SST_PTCL(wn1, wnp1clr)             && select pointer color
  336. _SDRW_WN(wn1)                       && draw the window on the screen
  337. USE customer                        && open the database
  338. KEYBOARD CHR(27)                    && stuff keyboard with an escape to 
  339.                                     && terminate the _WN_DBF() function
  340.  
  341. * call the _WN_DBF() function
  342. ret_rec =  _wn_dbf(wn1, "custno", "comp_name", "comp_addr1", "comp_addr2", "comp_city", "comp_state", "comp_zip", "comp_phone")
  343.  
  344. * reset back to top of file
  345. GO TOP
  346.  
  347. _SCLS_WN(wn2)                       && clear the text window
  348.  
  349. * write more text
  350. _SWTE_TXT(wn2, "     Notice the records in the window. These are from the demo database ")
  351. _SWTE_TXT(wn2, "   CUSTOMER.DBF. The pointer on the left side of the window can be moved ")
  352. _SWTE_TXT(wn2, "   through the database in several ways. The directional keys on the ")
  353. _SWTE_TXT(wn2, "   numeric key pad are used to navigate through the database. ")
  354. _SWTE_TXT(wn2, "                          Press Any Key To Continue")
  355.  
  356. INKEY(0)
  357. _SCLS_WN(wn2)                       && clear the text window
  358.  
  359. * etc.
  360. _SWTE_TXT(wn2, "     The keys that can be used are as follows: The up & down arrow keys")
  361. _SWTE_TXT(wn2, "   move you through the database a record at a time. The HOME & END keys")
  362. _SWTE_TXT(wn2, "   will place you on the record that is at the top or bottom of the ")
  363. _SWTE_TXT(wn2, "   window respectively. ")
  364. _SWTE_TXT(wn2, "                         Press Any Key To Continue")
  365. INKEY(0)
  366.  
  367. _SCLS_WN(wn2)                       && clear the text window
  368. _SWTE_TXT(wn2, "     The CTRL-HOME & CTRL-END keys move you to the top or bottom of the ")
  369. _SWTE_TXT(wn2, "   the database respectively. The PgDn & PgUp keys will move you forward")
  370. _SWTE_TXT(wn2, "   or backward through the database a page at a time. The page size is ")
  371. _SWTE_TXT(wn2, "   the same as the window size. A 10 row window will have a 10 record page.") 
  372. _SWTE_TXT(wn2, "                         Press Any Key To Continue")
  373. INKEY(0)
  374.  
  375. _SCLS_WN(wn2)                       && clear the text window
  376. _SWTE_TXT(wn2, "     The left & right arrow key will scroll the database information left")
  377. _SWTE_TXT(wn2, "   or right one field at a time. The window pointer will remain in the ")
  378. _SWTE_TXT(wn2, "   same place, only the text will be moved.")
  379. _SWTE_TXT(wn2, "                         Press Any Key To Continue")
  380. INKEY(0)
  381.  
  382. _SCLS_WN(wn2)                       && clear the text window
  383. _SWTE_TXT(wn2, "     The RETURN key, when pressed will terminate the _WN_DBF() function and")
  384. _SWTE_TXT(wn2, "   return the record number that the window pointer is currently sitting ")
  385. _SWTE_TXT(wn2, "   on. The ESC key, when pressed will terminate the _WN_DBF() function and")
  386. _SWTE_TXT(wn2, "   return 0. Indicating no record was selected.")
  387. _SWTE_TXT(wn2, "                         Press Any Key To Continue")
  388. INKEY(0)
  389.  
  390. _SCLS_WN(wn2)                       && clear the text window
  391. _SWTE_TXT(wn2, "     Now, take it for a test drive, trying out the different navigational keys.")
  392. _SWTE_TXT(wn2, "   The above window will clear and the database records will be written again.")
  393. _SWTE_TXT(wn2, "   At that point, you can press any key you want. Don't forget to press the ")
  394. _SWTE_TXT(wn2, "   ESC or RETURN key when you're finished.")
  395. _SWTE_TXT(wn2, "                         Press Any Key To START")
  396. INKEY(0)
  397.  
  398. _SCLS_WN(wn1)
  399. * call the _WN_DBF() function
  400. ret_rec =  _wn_dbf(wn1, "custno", "comp_name", "comp_addr1", "comp_addr2", "comp_city", "comp_state", "comp_zip", "comp_phone")
  401.  
  402. _SCLS_WN(wn2)
  403. _SWTE_TXT(wn2, "     The record you were on when you terminated was " + STR(ret_rec,2) + ". The window pointer")
  404. _SWTE_TXT(wn2, "   used for this part of the demonstration is the first of two available.")
  405. _SWTE_TXT(wn2, "   Let's do it again changing the pointer color and using the second window")
  406. _SWTE_TXT(wn2, "   pointer type. ")
  407. _SWTE_TXT(wn2, "                         Press Any Key To START")
  408. INKEY(0)
  409.  
  410. * reset to top of file
  411. GO TOP
  412.  
  413. _SST_PTCL(wn1, wnp3clr)     && set pointer color
  414. _SST_PTSL(wn1, 2)           && select new style pointer type 
  415. _SCLS_WN(wn1)
  416.  
  417. * call the _WN_DBF() function
  418. ret_rec =  _wn_dbf(wn1, "custno", "comp_name", "comp_addr1", "comp_addr2", "comp_city", "comp_state", "comp_zip", "comp_phone")
  419.  
  420. _SCLS_WN(wn2)
  421. _SWTE_TXT(wn2, "     The record you were on when you terminated was " + STR(ret_rec,2) + ". This and ")
  422. _SWTE_TXT(wn2, "   and much more is available to you in the Windows For Clipper library.")
  423. _SWTE_TXT(wn2, " ")
  424. _SWTE_TXT(wn2, "                         Press Any Key To Continue")
  425. INKEY(0)
  426.  
  427. * remove windows from memory
  428. _SREM_WN(wn1)
  429. _SREM_WN(wn2)
  430.  
  431. * clear the screen
  432. CLEAR
  433.  
  434. * init another window
  435. wn1 = _SINIT_WN(0, 0, 50,10)
  436.  
  437. * set borders, colors etc.
  438. _SST_WNBC(wn1, sgldbl)
  439. _SST_WNCL(wn1, wnc1clr, "C")
  440. _SST_WNCL(wn1, wnc7clr, "B")
  441.  
  442. * put it on the screen
  443. _SDRW_WN(wn1)
  444.  
  445. * etc.
  446. _SWTE_TXT(wn1, "   You have complete control of the")
  447. _SWTE_TXT(wn1, " Windows you create. You can move")
  448. _SWTE_TXT(wn1, " them....")
  449. INKEY(5)
  450.  
  451. * move the window on the screen
  452. _SMOVE_WN(wn1, 12, 8)
  453. _SWTE_TXT(wn1, " You can erase, clear or remove them.")
  454. _SWTE_TXT(wn1, " You can write text in them using ")
  455. _SWTE_TXT(wn1, " the functions provided in the library,")
  456. _SWTE_TXT(wn1, " or you can use the Clipper @ SAY command.")
  457. _SWTE_TXT(wn1, " The routines are functional as well as ")
  458. _SWTE_TXT(wn1, " flexible. ")
  459. INKEY(15)
  460.  
  461. * clear the window and write more text
  462. _SCLS_WN(wn1)
  463. _SWTE_TXT(wn1, "  If you use the functions in the library")
  464. _SWTE_TXT(wn1, " to write text, you never have to worry")
  465. _SWTE_TXT(wn1, " about long lines. The window output functions")
  466. _SWTE_TXT(wn1, " will insure your windows integrity is never")
  467. _SWTE_TXT(wn1, " destroyed. For instants:")
  468. _SWTE_TXT(wn1, " ")
  469. _SWTE_TXT(wn1, " This is a long line. This is a long line. This is a long line.")
  470. _SWTE_TXT(wn1, " This applies to all borders of the window. The")
  471. _SWTE_TXT(wn1, " top, bottom and sides.")
  472. INKEY(15)
  473. * erase the window
  474. _SWNERASE(wn1)
  475.  
  476. * turn on the cursor
  477. SET CURSOR ON
  478. *******************************
  479. * Demonstrate windowing using *
  480. * Clippers  memo utilities.   *
  481. *******************************
  482. * set clipper colors if necessary
  483. IF ISCOLOR()
  484.    SET COLOR TO +W/B
  485. ENDIF
  486. CLEAR
  487.  
  488. *************************************
  489. * write standard text to the screen *
  490. * in a different way.               *
  491. *************************************
  492. TEXT
  493.  
  494.          This portion of the demo program will present techniques
  495.        that can be used with Windows For Clipper, and a memo 
  496.        function provided with the compiler. The same techniques
  497.        can also be applied to the dbedit function, although it
  498.        may be difficult to determine where the dbedit function will
  499.        place the information. 
  500.  
  501.          In the following demonstration a window will be created, and 
  502.        help text that explains the cursor controls will be written to
  503.        the window. Next the MEMOEDIT function will be called. The 
  504.        screen coordinates required by the MEMOEDIT function will be 
  505.        inside the window. At that point the MEMOEDIT function will 
  506.        take control until you terminate it. Once terminated, the 
  507.        window will be removed and this text should re-appear. 
  508.         
  509.        
  510.                        Press Any Key To Continue
  511. ENDTEXT
  512. ************************
  513. * wait for a key press *
  514. ************************
  515.  
  516. INKEY(0)
  517.  
  518. *****************************
  519. * Create a window to cover  *
  520. * the entire screen.        *
  521. *****************************
  522. wn2 = 0
  523. wn2 = _SINIT_WN(0,0,78,23)
  524.  
  525. *****************************************
  526. * If we made it this far, no need to be *
  527. * sure if the window will be created.   *
  528. * So, set the border character.         *
  529. *****************************************
  530. _SST_WNBC(wn2, double)
  531.  
  532. * set colors
  533. _SST_WNCL(wn2, wnc5clr, "C")
  534. _SST_WNCL(wn2, wnb1clr, "B")
  535. *************************************
  536. * now draw the window on the screen *
  537. *************************************
  538. _SDRW_WN(wn2)
  539.  
  540. ********************************
  541. * Write the help information   *
  542. * to the window using Clipper. *
  543. ********************************
  544. @ 01,32 SAY "Cursor Control"
  545. @ 02,05 SAY ""+chr(24)+" or ^E  = Move up a line            HOME  = Beginning of current line"
  546. @ 03,05 SAY ""+chr(25)+" or ^X  = Move down a line          END   = End of current line"
  547. @ 04,05 SAY ""+chr(27)+" or ^S  = Move left a char.         ^HOME = Beginning of text"
  548. @ 05,05 SAY ""+chr(26)+" or ^D  = Move right a char.        ^END  = End of text"
  549. @ 06,05 SAY "^"+chr(27)+" or ^A = Move left a word          PgUp  = Jump to previous page"
  550. @ 07,05 SAY "^"+chr(26)+" or ^F = Move right a word         PgDn  = Jump to next page"
  551. @ 08,05 SAY "^PgUp    = Jump to top of screen     ^PgDn = Jump to bottom of screen"
  552. @ 09,00 SAY "╠══════════════════════════════════════════════════════════════════════════════╣"
  553. @ 10,29 SAY "Delete & Exit Control"
  554. @ 11,12 SAY "^Y = Delete current line             ^B = Reformat text"
  555. @ 12,12 SAY "^T = Delete word right               ESC = Exit no Save"
  556. @ 13,30 SAY "^W = Exit with Save"
  557. @ 14,00 SAY "╠══════════════════════════════════════════════════════════════════════════════╣"
  558. * "══════════════════════════════════════════════════════════════════════════════"
  559.  
  560. ***********************************************
  561. * Okay, time to access the memoedit function. *
  562. * The previous database is still in use.      *
  563. * Position the record pointer to record 10.   *
  564. * This is where the demo text is located in   *
  565. * the memo file. One thing, if you decided to *
  566. * to use this feature in this way, you need   *
  567. * to be sure of is that the MEMOEDIT row,     *
  568. * column coordinates do not exceed the        *
  569. * boundaries of the window.                   *
  570. ***********************************************
  571. GOTO(10)
  572. MEMOEDIT(memo1, 15,1,23,78,.t.)
  573.  
  574. *******************************
  575. * on return from the memoedit *
  576. * function remove the window. *
  577. *******************************
  578. _SREM_WN(wn2)
  579.  
  580. SET CURSOR OFF
  581. CLEAR
  582. _SDRW_WN(wn1)
  583. _SWTE_TXT(wn1, "  This concludes the Windows For Clipper Demo.")
  584. _SWTE_TXT(wn1, " For more information, please refer to the Windows")
  585. _SWTE_TXT(wn1, " For Clipper documentation and the REGISTER.DOC ")
  586. _SWTE_TXT(wn1, " file included with this demo.")
  587. _SWTE_TXT(wn1, " ")
  588. _SWTE_TXT(wn1, "             Press Any Key To Continue")
  589. INKEY(0)
  590. SET CURSOR ON
  591.  
  592. * remove windows from memory
  593. _SREM_WN(wn1)
  594. CLEAR
  595. RETURN
  596.  
  597. FUNCTION mv_wn
  598. *************************************************
  599. * This function moves the windows that contain  *
  600. * the large letters for the demo.               *
  601. *************************************************
  602.  
  603. parameter window, stop, delay
  604. wnrow = 16
  605. **************************************************
  606. * this loop moves window right across the screen *
  607. **************************************************
  608. FOR wncol = 8 TO 64 STEP 8
  609.    timer = 0
  610.    **********************************************
  611.    * move the window to new column, row coords. *
  612.    **********************************************
  613.    _smove_wn(window, wncol, wnrow)
  614.    DO WHILE timer <= delay
  615.       timer = timer + 1
  616.    ENDDO
  617. NEXT
  618. *****************************************************
  619. *  this loop moves window down right side of screen *
  620. *****************************************************
  621. wncol = 64
  622. FOR wnrow = 8 TO 0 STEP -8
  623.    timer = 0
  624.    **********************************************
  625.    * move the window to new column, row coords. *
  626.    **********************************************
  627.    _smove_wn(window, wncol, wnrow)
  628.    DO WHILE timer <= delay
  629.       timer = timer + 1
  630.    ENDDO
  631. NEXT
  632. *************************************************
  633. * this loop moves window left across the screen *
  634. *************************************************
  635. wnrow = 0
  636. FOR wncol = 56 TO stop STEP -8
  637.    timer = 0
  638.    _smove_wn(window, wncol, wnrow)
  639.    **********************************************
  640.    * move the window to new column, row coords. *
  641.    **********************************************
  642.    DO WHILE timer <= delay
  643.       timer = timer + 1
  644.    ENDDO
  645. NEXT
  646.